#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:5.py
# author:张世航
# datetime:2024/10/31 17:06
# software: PyCharm
"""
this is function  description 
"""
# import module your need


# 练习:
#    使用不定长参数定义2个函数（只定义一个形参）;分别实现对输入数据的封装(封装成一个列表和字典),然后打印输出;


def encapsulate_as_list(*args):
    return list(args)

def encapsulate_as_dict(**kwargs):
    return kwargs

# 测试不定长参数
list_result = encapsulate_as_list(1, 2, 3, 4, 5)
dict_result = encapsulate_as_dict(a=1, b=2, c=3)

print("封装成列表:", list_result)
print("封装成字典:", dict_result)